<template>
	<view class="pagesbg">
		<!-- 头部 -->
		<pagehead :pagesPath="'/pagesMain/order/order'">{{ type ==1?'支付成功':'支付失败'}}</pagehead>
		<!-- 主体 -->
		<view class="success">
			<image class="imgStatus" v-if="type ==1" :src="IMAGE_STATIC+'/images/success.png'" mode=""></image>
			<view class="price"><text class="unit">￥</text>{{ orderInfo.price }}</view>
			<view class="txt" v-if="type ==2">已提交</view>
		<view class="info-warp">
		<view class="info">
			<view class="label">订单号：</view>
			<view class="txt">{{ orderInfo.orderId }}</view>
		</view>
		<view class="info">
			<view class="label">交易时间：</view>
			<view class="txt">{{ orderInfo.crateTime }}</view>
		</view>
		</view>
		<view class="submit" @click="view()">查看订单</view>
	</view>
		
	</view>
</template>

<script>
	export default {
		components:{
		},
		data(){
			return{
				IMAGE_STATIC: this.$url.assetsPath, // 静态图片地址
				type: '',
				orderInfo:{
					orderId:'222',
					crateTime:'2024',
					price:100
				},
			}
		},
		onLoad(options) {
			this.type = options.value1;
			console.log(this.type);
		},
		onShow() {
			
		},
		methods: {
			// 重写返回方法
			backMethod(){
				this.$tools.redirectTo('/pages/order/order');
				// if(this.type == '1'){
				// 	this.$tools.redirectTo('/pages/order/order');
				// }else if(this.type == '2'){
				// 	this.$tools.redirectTo('/pages/user/buyOrder');
				// }
			},
			view(){
				this.$tools.redirectTo('/pages/order/order');
			},
		}
	}
</script>

<style lang="scss" scoped>
	.success{
		@include flexCenterColumn;
		margin: 64rpx auto;
		.imgStatus{
			width: 128rpx;
			height: 128rpx;
		}
		.price{
			text-align: center;
			font-size: 72rpx;
			color: #333333;
			font-weight: 500;
			margin-top: 48rpx;
			.unit{
				font-size: 48rpx;
				font-weight: normal;
			}
		}
		.txt{
			font-size: 28rpx;
			color: rgba(51,51,51,0.9);
			line-height: 48rpx;
			margin-top: 24rpx;
		}
		.info-warp{
			width: 93.6%;
			margin: auto;
			margin-top: 48rpx;
			background: #fff;
			border-radius: 12rpx;
			padding: 20rpx 48rpx;
			overflow: hidden;
			.info{
				@include flexBetween;
				font-size: 28rpx;
				line-height: 50rpx;
				margin-bottom: 20rpx;
				.label{
					color: rgba(51,51,51, 0.6);
				}
				.txt{
					color: #333333;
				}
			}
			.info:last-of-type{
				margin-bottom:0;
			}
		}
		.submit{
			height: 90rpx;
			line-height: 90rpx;
			background: #AD2926;
			border-radius: 118rpx;
			width: 91.4%;
			margin: 20rpx auto;
			text-align: center;
			color: #fff;
			font-size: 30rpx;
			margin-top: 60rpx;
		}
	}
	.status{
		&-title{
			font-size: 30rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			color: #FFFFFF;
			margin: 28rpx auto 0;
		}
		&-btn{
			background: linear-gradient(180deg, #FF9548 0%, #FF3C3C 100%);
			border-radius: 86rpx;
			font-size: 30rpx;
			font-family: PingFang SC-Regular, PingFang SC;
			font-weight: 400;
			color: #FFFFFF;
			padding: 20rpx 198rpx 18rpx;
		}
		&-time{
			font-size: 24rpx;
			font-family: PingFang SC-Regular, PingFang SC;
			font-weight: 400;
			color: #666666;
		}
	}
</style>